<!--银行卡管理-->
<template>
  <div class="app-container">
    <div style="margin-bottom: 20px;">
      <el-button type="success" icon="el-icon-plus" plain size="mini" @click="$router.push({ path: '/channel/channelList' })" v-hasPermi="['video:list:add']">新增</el-button>
    </div>
    <el-table v-loading="loading" :data="dataList">
      <el-table-column label="代理线名称" align="center" prop="name" width="180" :show-overflow-tooltip="true"/>
      <el-table-column label="已过期数/30天过期数" align="center" prop="" width="180" :show-overflow-tooltip="true">
      <template slot-scope="scope">
          {{ scope.row.expireNumber }} / {{ scope.row.expireRecent }}
        </template>
      </el-table-column>
      <el-table-column label="团队人数" align="center" prop="num" width="180" :show-overflow-tooltip="true"/>
      <el-table-column label="昨日新增/7天新增/30天新增" align="center" prop="" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          {{ scope.row.yesterdayAdd }} / {{ scope.row.sevenDaysAdd }} / {{ scope.row.thirtyDaysAdd }}
        </template>
      </el-table-column>
      <el-table-column label="团队余额" align="center" prop="teamBalance" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ $yun.formatAmount(scope.row.teamBalance) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="团队充提差" align="center" prop="teamDifference" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ $yun.formatAmount(scope.row.teamDifference) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="团队待审核提现" align="center" prop="teamWithdrawalAuditing" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ $yun.formatAmount(scope.row.teamWithdrawalAuditing) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="团队昨日提现" align="center" prop="withdrawalYesterday" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ $yun.formatAmount(scope.row.withdrawalYesterday) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="团队今日发起提现" align="center" prop="withdrawalToday" width="180" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ $yun.formatAmount(scope.row.withdrawalToday) }}</span>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                @pagination="getList"
    />
    <!-- 添加或修改 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules">
        <el-form-item label="代理线名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入代理线名称"/>
        </el-form-item>
        <el-form-item label="已过期数/30天过期数" prop="expireNumber">
          <el-input v-model="form.expireNumber" placeholder="请输入已过期数/30天过期数"/>
        </el-form-item>
        <el-form-item label="团队人数" prop="num">
          <el-input v-model="form.num" type="number" placeholder="请输入团队人数"/>
        </el-form-item>
        <el-form-item label="昨日新增" prop="yesterdayAdd">
          <el-input v-model="form.yesterdayAdd" placeholder="请输入昨日新增"/>
        </el-form-item>
        <el-form-item label="7天新增" prop="sevenDaysAdd">
          <el-input v-model="form.sevenDaysAdd" placeholder="请输入7天新增"/>
        </el-form-item>
        <el-form-item label="昨日30天新增" prop="expireRecent">
          <el-input v-model="form.expireRecent" placeholder="请输入30天新增"/>
        </el-form-item>
        <el-form-item label="团队余额" prop="teamBalance">
          <el-input v-model="form.teamBalance" type="number" placeholder="请输入团队余额"/>
        </el-form-item>
        <el-form-item label="团队充提差" prop="teamDifference">
          <el-input v-model="form.teamDifference" placeholder="请输入团队充提差"/>
        </el-form-item>
        <el-form-item label="团队待审核提现" prop="teamWithdrawalAuditing">
          <el-input v-model="form.teamWithdrawalAuditing" placeholder="请输入团队待审核提现"/>
        </el-form-item>
        <el-form-item label="团队昨日提现" prop="withdrawalYesterday">
          <el-input v-model="form.withdrawalYesterday" placeholder="请输入团队昨日提现"/>
        </el-form-item>
        <el-form-item label="团队今日发起提现" prop="withdrawalToday">
          <el-input v-model="form.withdrawalToday" placeholder="请输入团队今日发起提现"/>
        </el-form-item>
      </el-form>
<!--      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>-->
    </el-dialog>
  </div>
</template>

<script>
import OssImagePreview from '@/components/ImagePreview/oss-image-preview.vue'
import { addressAdd, addressDel, addressEdit, addressPage } from '@/api/user/userAddress'
import {teamPage} from "@/api/user/teamData";
import Template from "@/views/setting/template/index.vue";

export default {
  name: 'bankCardManage',
  components: {Template, OssImagePreview },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      // 用户完成线下理财信息表格数据
      dataList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      open: false,
      title: '',
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        // userName: { required: true, message: '用户名不能为空', trigger: 'blur' },
      },
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询用户完成线下理财信息列表 */
    getList() {
      this.loading = true
      teamPage(this.queryParams).then(response => {
        this.dataList = response.data.records
        this.total = response.data.total
        this.loading = false
      })
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.handleQuery()
    },
    /** 新增 */
    handleAdd(row) {
      this.reset()
      this.open = true
      this.title = '添加数据'
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {}
      this.resetForm('form')
    },
  }
}
</script>
